.bg{
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0,0,0,0.3);
    z-index: 999;
}

.test{
    width: 300px;
    height: 200px;
    background-color: white;
    border-radius: 10px;
    text-align: center;
    line-height: 200px;

    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}